home *** CD-ROM | disk | FTP | other *** search
/ Power Bytes: Money & Finance / PowerBytes Money and Finance CD-ROM 01 / PowerBytes Money and Finance CD-ROM 01.iso / Demos / TrueBASIC Demo / Libraries / FntLib < prev    next >
Encoding:
Text File  |  1985-05-31  |  770 b   |  42 lines  |  [TEXT/TRUE]

  1. !  Library of trigonometric functions (radians)
  2. !  Copyright (c) 1985 by True BASIC, Inc.
  3.  
  4. EXTERNAL
  5.  
  6. DEF cot(x) = 1/tan(x)
  7.  
  8. DEF sec(x) = 1/cos(x)
  9.  
  10. DEF csc(x) = 1/sin(x)
  11.  
  12. DEF asin(x)
  13.     IF abs(x)<1 then
  14.        LET asin = atn(x/sqr(1-x*x))
  15.     ELSEIF x=1 then
  16.        LET asin = pi/2
  17.     ELSEIF x=-1 then
  18.        LET asin = -pi/2
  19.     ELSE
  20.        CAUSE EXCEPTION -3000, "Argument not in range"
  21.     END IF
  22. END DEF
  23.  
  24. DEF acos(x)
  25.     DECLARE DEF asin
  26.     LET acos = pi/2 - asin(x)
  27. END DEF
  28.  
  29. DEF acot(x) = pi/2 - atn(x)
  30.  
  31. DEF asec(x)
  32.     DECLARE DEF acos
  33.     IF x=0 then CAUSE EXCEPTION -3000, "Argument not in range"
  34.     LET asec = acos(1/x)
  35. END DEF
  36.  
  37. DEF acsc(x)
  38.     DECLARE DEF asin
  39.     IF x=0 then CAUSE EXCEPTION -3000, "Argument not in range"
  40.     LET acsc = asin(1/x)
  41. END DEF
  42.